package com.itheima.d5_collection_test.test;

 class Card implements Comparable<Card>{
    private String number; //点数
    private String color; //花色
    // 每张牌是存在大小的。
    private int size; // 0 1 2 ....

    public Card() {
    }

    public Card(String number, String color, int size) {
        this.number = number;
        this.color = color;
        this.size = size;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

     @Override
     public String toString() {
         return color + number;
     }

     @Override
     public int compareTo(Card o) {
         return Integer.compare(this.size, o.size); //升序
     }
 }
